package com.corpgovernment.organization.entity.db;

import com.corpgovernment.common.annotation.OperateLogFieldDesc;
import com.corpgovernment.common.entity.db.BaseEntity;
import com.corpgovernment.common.enums.DeleteStatusEnum;
import com.corpgovernment.common.handler.Sm4TypeHandler;
import com.corpgovernment.organization.enumm.RightsEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import tk.mybatis.mapper.annotation.ColumnType;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * 岗位信息
 *
 * @author wangyujue
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Table(name = "mb_post_info")
public class MbPostInfo extends BaseEntity {

    /**
     * 主键
     */
    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @OperateLogFieldDesc(value = "主键")
    private Long id;

    /**
     * 岗位名字
     */
    @Column(name = "name")
    @OperateLogFieldDesc(value = "岗位名字")
	@ColumnType(typeHandler = Sm4TypeHandler.class)
    private String name;

    /**
     * 组织结构id
     */
    @Column(name = "org_id")
    @OperateLogFieldDesc(value = "组织结构id")
    private String orgId;

    /**
     * 岗位权限（0：普通员工 1：行政秘书 2：涉外秘书）
     */
    @Column(name = "rights")
    @OperateLogFieldDesc(value = "岗位权限", type = RightsEnum.class)
    private String rights;

    /**
     * 删除状态
     */
    @Column(name = "is_deleted")
    @OperateLogFieldDesc(value = "删除状态", type = DeleteStatusEnum.class)
    private Boolean isDeleted;

    /**
     * 职级补助
     */
    @Column(name = "allowance")
    @OperateLogFieldDesc(value = "职级补助")
    private BigDecimal allowance;
    /**
     * 岗位编号
     */
    @Column(name = "code")
    @OperateLogFieldDesc(value = "岗位编号")
    private String code;
}
